package com.svms.save.vo;


/**
 * 
* <p>Title: Layui表格数据返回结果</p>  
* <p>Description: </p>  
* @author xuyang
* @date 2020年3月17日
 */
public class LayuiTableResult<T> {
	/**返回编码*/
	private int code;
	/**返回消息*/
	private String msg;
	/**数据总量*/
	private long count;
	/**当前页数*/
	private int currentPageNo;
	/**每页显示多少条数据*/
	private int pageSize;
	/**返回数据结果*/
	private T data;
	/**返回编码*/
	public int getCode() {
		return code;
	}
	/**返回编码*/
	public void setCode(int code) {
		this.code = code;
	}
	/**返回消息*/
	public String getMsg() {
		return msg;
	}
	/**返回消息*/
	public void setMsg(String msg) {
		this.msg = msg;
	}
	/**数据总量*/
	public long getCount() {
		return count;
	}
	/**数据总量*/
	public void setCount(long count) {
		this.count = count;
	}
	/**返回数据结果*/
	public T getData() {
		return data;
	}
	/**返回数据结果*/
	public void setData(T data) {
		this.data = data;
	}
	
	public int getCurrentPageNo() {
		return currentPageNo;
	}
	public void setCurrentPageNo(int currentPageNo) {
		this.currentPageNo = currentPageNo;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public static LayuiTableResult createTableResult(Page page,String code,String msg){
		LayuiTableResult tableResult = new LayuiTableResult();
		tableResult.setCode(Integer.parseInt(code));
		tableResult.setMsg(msg);
		tableResult.setCount(page.getTotail());
		tableResult.setData(page.getResult());
		tableResult.setPageSize(page.getPageSize());
		tableResult.setCurrentPageNo(page.getCurrentPageNo());
		return tableResult;
	}
}
